import { UserInfo } from '@/utils/auth';

/**
 * @see https://umijs.org/docs/max/access#access
 * */
export default function access(initialState: { currentUser?: UserInfo } | undefined) {
  const { currentUser } = initialState ?? {};
  return {
    RoleUser: currentUser && currentUser.access === 'RoleUser',
    SysAdmin: currentUser && currentUser.access === 'SysAdmin',
  };
}
